﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace edu.Web
{
    public static class AppConfig
    {
        //private static readonly string _connectionString = ConfigurationManager.AppSettings["appWall"].ToString();

        private static readonly int _wallLeftLimit = int.Parse(ConfigurationManager.AppSettings["WallLeftLimit"].ToString());
        private static readonly int _wallTopLimit = int.Parse(ConfigurationManager.AppSettings["WallTopLimit"].ToString());

        private static readonly int _styleCount = int.Parse(ConfigurationManager.AppSettings["StyleCount"].ToString())+1;
        private static readonly int _imageCount = int.Parse(ConfigurationManager.AppSettings["ImageCount"].ToString())+1;

        private static readonly string _padTemplate = ConfigurationManager.AppSettings["WallPadTemplate"].ToString();

        /// <summary>
        /// 数据库连接串
        /// </summary>
        //public static string ConnectionString
        //{
        //    get { return _connectionString; }
        //}
        /// <summary>
        /// 墙帖的屏幕上边距
        /// </summary>
        public static int WallTopLimit
        {
            get { return _wallTopLimit; }
        }
        /// <summary>
        /// 墙帖的屏幕左边距
        /// </summary>
        public static int WallLeftLimit
        {
            get { return _wallLeftLimit; }
        }
        /// <summary>
        /// 墙帖的模板，因为是保存在 web.config 内，所以做了htmlencode
        /// </summary>
        public static string PadTemplate
        {
            get { return System.Web.HttpUtility.HtmlDecode(_padTemplate); }
        }
        /// <summary>
        /// 背景样式数
        /// </summary>
        public static int StyleCount
        {
            get { return _styleCount; }
        }
        /// <summary>
        /// 贴图数
        /// </summary>
        public static int ImageCount
        {
            get { return _imageCount; }
        }
    }
}